package com.test.day02.threadPool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @program: jdk1.5之后提供的线程池
 * @author: luhd
 * @create: 2021-08-01
 */
public class ThreadPool {
    public static void main(String[] args) {
        ExecutorService es = Executors.newFixedThreadPool(2);
        es.submit(new RunnableImpl());
        // 线程池会一直开启，使用完了线程，会自动把线程归还给线程池
        es.submit(new RunnableImpl());
        es.submit(new RunnableImpl());
    }
}
